package com.ply.flashsalessystem.entity.vo.manage;

import com.ply.flashsalessystem.entity.pojo.Goods;
import com.ply.flashsalessystem.entity.status.GoodsPutAwayStatus;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * @author XiaoPan
 * date: 2022/4/25 16:30
 * <p>
 * action:
 */
@EqualsAndHashCode(callSuper = true)
@Data
// 只给 管理员 看
public class GoodsVO extends Goods {
    String tagName;

    // 上下架 情况
    String putAwayString;

    //增加 商品 意义
    public static List<GoodsVO> addPutAwayString(List<GoodsVO> records){
        for (GoodsVO record : records) {
            switch (record.getPutAway()) {
//                case GoodsPutAwayStatus.NO_AWAY:
                case 0:
                    record.setPutAwayString(GoodsPutAwayStatus.NO_AWAY_STRING);
                    break;
//                case GoodsPutAwayStatus.DO_AWAY:
                case 1:
                    record.setPutAwayString(GoodsPutAwayStatus.DO_AWAY_STRING);
                    break;
                default:
                    record.setPutAwayString("未定义");
                    break;
            }
        }
        return records;
    }



}
